/**
 * Created by claim on 17-3-12.
 */
let fs = require('fs');

let content;

fs.readFile('./Callback.js', (err, data) => {
    if (!err)
        content = data;
    else
        console.log(err);
});

console.log(content);
//在回调函数中修改了content, 仍为undefined, 从这里可以判断该方法的回调是异步的

setTimeout(() => {
    console.log(content);
}, 1000); //Delay 1000 ms for logging